<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>添加部署</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" type="text/css" href="$request.getContextPath()/resources/layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="$request.getContextPath()/resources/bootstrap-datepicker/css/bootstrap-datepicker3.min.css">
</head>
<body>
    <h3 align="center">请上传zip文件</h3>
    <div align="center">
	   <input type="file" name="file" class="layui-upload-file">
    </div>
</body>
<script src="$request.getContextPath()/resources/jquery/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="$request.getContextPath()/resources/layui/layui.js"></script>
<script type="text/javascript" src="$request.getContextPath()/resources/layui/lay/modules/element.js"></script>
<script type="text/javascript">
	$(function() {
		//流程zip上传
		layui.use(['form','layedit','upload'], function() {
			var layer = layui.layer,layedit = layui.layedit;
			var userDescIndex=layedit.build('processDescription');
			layui.upload({
				url : '$request.getContextPath()/process/deployment/deploy',
				type : 'file',
				ext: 'zip',
				method : 'post',
				success : function(data) {
					if (data.code == 200) {
						var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
						parent.layer.close(index); //再执行关闭  
					}else{
						layer.alert(data.msg);
					}
				}
			});
		});
	});
</script>
</html>